PROP_HEXPAND_SET,
PROP_VEXPAND_SET,
PROP_EXPAND,
- PROP_SCALE_FACTOR
+ PROP_SCALE_FACTOR,
+ NUM_PROPERTIES
};
+static GParamSpec *widget_props[NUM_PROPERTIES] = { NULL, };
+
typedef struct _GtkStateData GtkStateData;
struct _GtkStateData
klass->adjust_baseline_allocation = gtk_widget_real_adjust_baseline_allocation;
klass->queue_draw_region = gtk_widget_real_queue_draw_region;
- g_object_class_install_property (gobject_class,
- PROP_NAME,
- g_param_spec_string ("name",
- P_("Widget name"),
- P_("The name of the widget"),
- NULL,
- GTK_PARAM_READWRITE));
- g_object_class_install_property (gobject_class,
- PROP_PARENT,
- g_param_spec_object ("parent",
- P_("Parent widget"),
- P_("The parent widget of this widget. Must be a Container widget"),
- GTK_TYPE_CONTAINER,
- GTK_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class,
- PROP_WIDTH_REQUEST,
- g_param_spec_int ("width-request",
- P_("Width request"),
- P_("Override for width request of the widget, or -1 if natural request should be used"),
- -1,
- G_MAXINT,
- -1,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- g_object_class_install_property (gobject_class,
- PROP_HEIGHT_REQUEST,
- g_param_spec_int ("height-request",
- P_("Height request"),
- P_("Override for height request of the widget, or -1 if natural request should be used"),
- -1,
- G_MAXINT,
- -1,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- g_object_class_install_property (gobject_class,
- PROP_VISIBLE,
- g_param_spec_boolean ("visible",
- P_("Visible"),
- P_("Whether the widget is visible"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- g_object_class_install_property (gobject_class,
- PROP_SENSITIVE,
- g_param_spec_boolean ("sensitive",
- P_("Sensitive"),
- P_("Whether the widget responds to input"),
- TRUE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- g_object_class_install_property (gobject_class,
- PROP_APP_PAINTABLE,
- g_param_spec_boolean ("app-paintable",
- P_("Application paintable"),
- P_("Whether the application will paint directly on the widget"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- g_object_class_install_property (gobject_class,
- PROP_CAN_FOCUS,
- g_param_spec_boolean ("can-focus",
- P_("Can focus"),
- P_("Whether the widget can accept the input focus"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- g_object_class_install_property (gobject_class,
- PROP_HAS_FOCUS,
- g_param_spec_boolean ("has-focus",
- P_("Has focus"),
- P_("Whether the widget has the input focus"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- g_object_class_install_property (gobject_class,
- PROP_IS_FOCUS,
- g_param_spec_boolean ("is-focus",
- P_("Is focus"),
- P_("Whether the widget is the focus widget within the toplevel"),
- FALSE,
- GTK_PARAM_READWRITE));
- g_object_class_install_property (gobject_class,
- PROP_CAN_DEFAULT,
- g_param_spec_boolean ("can-default",
- P_("Can default"),
- P_("Whether the widget can be the default widget"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- g_object_class_install_property (gobject_class,
- PROP_HAS_DEFAULT,
- g_param_spec_boolean ("has-default",
- P_("Has default"),
- P_("Whether the widget is the default widget"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- g_object_class_install_property (gobject_class,
- PROP_RECEIVES_DEFAULT,
- g_param_spec_boolean ("receives-default",
- P_("Receives default"),
- P_("If TRUE, the widget will receive the default action when it is focused"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- g_object_class_install_property (gobject_class,
- PROP_COMPOSITE_CHILD,
- g_param_spec_boolean ("composite-child",
- P_("Composite child"),
- P_("Whether the widget is part of a composite widget"),
- FALSE,
- GTK_PARAM_READABLE));
+ widget_props[PROP_NAME] =
+ g_param_spec_string ("name",
+ P_("Widget name"),
+ P_("The name of the widget"),
+ NULL,
+ GTK_PARAM_READWRITE);
+
+ widget_props[PROP_PARENT] =
+ g_param_spec_object ("parent",
+ P_("Parent widget"),
+ P_("The parent widget of this widget. Must be a Container widget"),
+ GTK_TYPE_CONTAINER,
+ GTK_PARAM_READWRITE);
+
+ widget_props[PROP_WIDTH_REQUEST] =
+ g_param_spec_int ("width-request",
+ P_("Width request"),
+ P_("Override for width request of the widget, or -1 if natural request should be used"),
+ -1, G_MAXINT,
+ -1,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+ widget_props[PROP_HEIGHT_REQUEST] =
+ g_param_spec_int ("height-request",
+ P_("Height request"),
+ P_("Override for height request of the widget, or -1 if natural request should be used"),
+ -1, G_MAXINT,
+ -1,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+ widget_props[PROP_VISIBLE] =
+ g_param_spec_boolean ("visible",
+ P_("Visible"),
+ P_("Whether the widget is visible"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+ widget_props[PROP_SENSITIVE] =
+ g_param_spec_boolean ("sensitive",
+ P_("Sensitive"),
+ P_("Whether the widget responds to input"),
+ TRUE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+ widget_props[PROP_APP_PAINTABLE] =
+ g_param_spec_boolean ("app-paintable",
+ P_("Application paintable"),
+ P_("Whether the application will paint directly on the widget"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+ widget_props[PROP_CAN_FOCUS] =
+ g_param_spec_boolean ("can-focus",
+ P_("Can focus"),
+ P_("Whether the widget can accept the input focus"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+ widget_props[PROP_HAS_FOCUS] =
+ g_param_spec_boolean ("has-focus",
+ P_("Has focus"),
+ P_("Whether the widget has the input focus"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+ widget_props[PROP_IS_FOCUS] =
+ g_param_spec_boolean ("is-focus",
+ P_("Is focus"),
+ P_("Whether the widget is the focus widget within the toplevel"),
+ FALSE,
+ GTK_PARAM_READWRITE);
+
+ widget_props[PROP_CAN_DEFAULT] =
+ g_param_spec_boolean ("can-default",
+ P_("Can default"),
+ P_("Whether the widget can be the default widget"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+ widget_props[PROP_HAS_DEFAULT] =
+ g_param_spec_boolean ("has-default",
+ P_("Has default"),
+ P_("Whether the widget is the default widget"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+ widget_props[PROP_RECEIVES_DEFAULT] =
+ g_param_spec_boolean ("receives-default",
+ P_("Receives default"),
+ P_("If TRUE, the widget will receive the default action when it is focused"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+ widget_props[PROP_COMPOSITE_CHILD] =
+ g_param_spec_boolean ("composite-child",
+ P_("Composite child"),
+ P_("Whether the widget is part of a composite widget"),
+ FALSE,
+ GTK_PARAM_READABLE);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- g_object_class_install_property (gobject_class,
- PROP_STYLE,
- g_param_spec_object ("style",
- P_("Style"),
- P_("The style of the widget, which contains information about how it will look (colors etc)"),
- GTK_TYPE_STYLE,
- GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
+ widget_props[PROP_STYLE] =
+ g_param_spec_object ("style",
+ P_("Style"),
+ P_("The style of the widget, which contains information about how it will look (colors etc)"),
+ GTK_TYPE_STYLE,
+ GTK_PARAM_READWRITE|G_PARAM_DEPRECATED);
G_GNUC_END_IGNORE_DEPRECATIONS
- g_object_class_install_property (gobject_class,
- PROP_EVENTS,
- g_param_spec_flags ("events",
- P_("Events"),
- P_("The event mask that decides what kind of GdkEvents this widget gets"),
- GDK_TYPE_EVENT_MASK,
- GDK_STRUCTURE_MASK,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- g_object_class_install_property (gobject_class,
- PROP_NO_SHOW_ALL,
- g_param_spec_boolean ("no-show-all",
- P_("No show all"),
- P_("Whether gtk_widget_show_all() should not affect this widget"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_EVENTS] =
+ g_param_spec_flags ("events",
+ P_("Events"),
+ P_("The event mask that decides what kind of GdkEvents this widget gets"),
+ GDK_TYPE_EVENT_MASK,
+ GDK_STRUCTURE_MASK,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+ widget_props[PROP_NO_SHOW_ALL] =
+ g_param_spec_boolean ("no-show-all",
+ P_("No show all"),
+ P_("Whether gtk_widget_show_all() should not affect this widget"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:has-tooltip:
*
* Since: 2.12
*/
- g_object_class_install_property (gobject_class,
- PROP_HAS_TOOLTIP,
- g_param_spec_boolean ("has-tooltip",
- P_("Has tooltip"),
- P_("Whether this widget has a tooltip"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_HAS_TOOLTIP] =
+ g_param_spec_boolean ("has-tooltip",
+ P_("Has tooltip"),
+ P_("Whether this widget has a tooltip"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
/**
* GtkWidget:tooltip-text:
*
*
* Since: 2.12
*/
- g_object_class_install_property (gobject_class,
- PROP_TOOLTIP_TEXT,
- g_param_spec_string ("tooltip-text",
- P_("Tooltip Text"),
- P_("The contents of the tooltip for this widget"),
- NULL,
- GTK_PARAM_READWRITE));
+ widget_props[PROP_TOOLTIP_TEXT] =
+ g_param_spec_string ("tooltip-text",
+ P_("Tooltip Text"),
+ P_("The contents of the tooltip for this widget"),
+ NULL,
+ GTK_PARAM_READWRITE);
+
/**
* GtkWidget:tooltip-markup:
*
*
* Since: 2.12
*/
- g_object_class_install_property (gobject_class,
- PROP_TOOLTIP_MARKUP,
- g_param_spec_string ("tooltip-markup",
- P_("Tooltip markup"),
- P_("The contents of the tooltip for this widget"),
- NULL,
- GTK_PARAM_READWRITE));
+ widget_props[PROP_TOOLTIP_MARKUP] =
+ g_param_spec_string ("tooltip-markup",
+ P_("Tooltip markup"),
+ P_("The contents of the tooltip for this widget"),
+ NULL,
+ GTK_PARAM_READWRITE);
/**
* GtkWidget:window:
*
* Since: 2.14
*/
- g_object_class_install_property (gobject_class,
- PROP_WINDOW,
- g_param_spec_object ("window",
- P_("Window"),
- P_("The widget's window if it is realized"),
- GDK_TYPE_WINDOW,
- GTK_PARAM_READABLE));
+ widget_props[PROP_WINDOW] =
+ g_param_spec_object ("window",
+ P_("Window"),
+ P_("The widget's window if it is realized"),
+ GDK_TYPE_WINDOW,
+ GTK_PARAM_READABLE);
/**
* GtkWidget:double-buffered:
*
* Deprecated: 3.14: Widgets should not use this property.
*/
- g_object_class_install_property (gobject_class,
- PROP_DOUBLE_BUFFERED,
- g_param_spec_boolean ("double-buffered",
- P_("Double Buffered"),
- P_("Whether the widget is double buffered"),
- TRUE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED));
+ widget_props[PROP_DOUBLE_BUFFERED] =
+ g_param_spec_boolean ("double-buffered",
+ P_("Double Buffered"),
+ P_("Whether the widget is double buffered"),
+ TRUE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED);
/**
* GtkWidget:halign:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_HALIGN,
- g_param_spec_enum ("halign",
- P_("Horizontal Alignment"),
- P_("How to position in extra horizontal space"),
- GTK_TYPE_ALIGN,
- GTK_ALIGN_FILL,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_HALIGN] =
+ g_param_spec_enum ("halign",
+ P_("Horizontal Alignment"),
+ P_("How to position in extra horizontal space"),
+ GTK_TYPE_ALIGN,
+ GTK_ALIGN_FILL,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:valign:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_VALIGN,
- g_param_spec_enum ("valign",
- P_("Vertical Alignment"),
- P_("How to position in extra vertical space"),
- GTK_TYPE_ALIGN,
- GTK_ALIGN_FILL,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_VALIGN] =
+ g_param_spec_enum ("valign",
+ P_("Vertical Alignment"),
+ P_("How to position in extra vertical space"),
+ GTK_TYPE_ALIGN,
+ GTK_ALIGN_FILL,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:margin-left:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_MARGIN_LEFT,
- g_param_spec_int ("margin-left",
- P_("Margin on Left"),
- P_("Pixels of extra space on the left side"),
- 0,
- G_MAXINT16,
- 0,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED));
+ widget_props[PROP_MARGIN_LEFT] =
+ g_param_spec_int ("margin-left",
+ P_("Margin on Left"),
+ P_("Pixels of extra space on the left side"),
+ 0, G_MAXINT16,
+ 0,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED);
/**
* GtkWidget:margin-right:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_MARGIN_RIGHT,
- g_param_spec_int ("margin-right",
- P_("Margin on Right"),
- P_("Pixels of extra space on the right side"),
- 0,
- G_MAXINT16,
- 0,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED));
+ widget_props[PROP_MARGIN_RIGHT] =
+ g_param_spec_int ("margin-right",
+ P_("Margin on Right"),
+ P_("Pixels of extra space on the right side"),
+ 0, G_MAXINT16,
+ 0,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED);
/**
* GtkWidget:margin-start:
*
* Since: 3.12
*/
- g_object_class_install_property (gobject_class,
- PROP_MARGIN_START,
- g_param_spec_int ("margin-start",
- P_("Margin on Start"),
- P_("Pixels of extra space on the start"),
- 0,
- G_MAXINT16,
- 0,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_MARGIN_START] =
+ g_param_spec_int ("margin-start",
+ P_("Margin on Start"),
+ P_("Pixels of extra space on the start"),
+ 0, G_MAXINT16,
+ 0,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:margin-end:
*
* Since: 3.12
*/
- g_object_class_install_property (gobject_class,
- PROP_MARGIN_END,
- g_param_spec_int ("margin-end",
- P_("Margin on End"),
- P_("Pixels of extra space on the end"),
- 0,
- G_MAXINT16,
- 0,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_MARGIN_END] =
+ g_param_spec_int ("margin-end",
+ P_("Margin on End"),
+ P_("Pixels of extra space on the end"),
+ 0, G_MAXINT16,
+ 0,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:margin-top:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_MARGIN_TOP,
- g_param_spec_int ("margin-top",
- P_("Margin on Top"),
- P_("Pixels of extra space on the top side"),
- 0,
- G_MAXINT16,
- 0,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_MARGIN_TOP] =
+ g_param_spec_int ("margin-top",
+ P_("Margin on Top"),
+ P_("Pixels of extra space on the top side"),
+ 0, G_MAXINT16,
+ 0,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:margin-bottom:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_MARGIN_BOTTOM,
- g_param_spec_int ("margin-bottom",
- P_("Margin on Bottom"),
- P_("Pixels of extra space on the bottom side"),
- 0,
- G_MAXINT16,
- 0,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_MARGIN_BOTTOM] =
+ g_param_spec_int ("margin-bottom",
+ P_("Margin on Bottom"),
+ P_("Pixels of extra space on the bottom side"),
+ 0, G_MAXINT16,
+ 0,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:margin:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_MARGIN,
- g_param_spec_int ("margin",
- P_("All Margins"),
- P_("Pixels of extra space on all four sides"),
- 0,
- G_MAXINT16,
- 0,
- GTK_PARAM_READWRITE));
-
- /**
- * GtkWidget::destroy:
- * @object: the object which received the signal
- *
- * Signals that all holders of a reference to the widget should release
- * the reference that they hold. May result in finalization of the widget
- * if all references are released.
- *
- * This signal is not suitable for saving widget state.
- */
- widget_signals[DESTROY] =
- g_signal_new (I_("destroy"),
- G_TYPE_FROM_CLASS (gobject_class),
- G_SIGNAL_RUN_CLEANUP | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
- G_STRUCT_OFFSET (GtkWidgetClass, destroy),
- NULL, NULL,
- _gtk_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ widget_props[PROP_MARGIN] =
+ g_param_spec_int ("margin",
+ P_("All Margins"),
+ P_("Pixels of extra space on all four sides"),
+ 0, G_MAXINT16,
+ 0,
+ GTK_PARAM_READWRITE);
/**
* GtkWidget:hexpand:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_HEXPAND,
- g_param_spec_boolean ("hexpand",
- P_("Horizontal Expand"),
- P_("Whether widget wants more horizontal space"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_HEXPAND] =
+ g_param_spec_boolean ("hexpand",
+ P_("Horizontal Expand"),
+ P_("Whether widget wants more horizontal space"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:hexpand-set:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_HEXPAND_SET,
- g_param_spec_boolean ("hexpand-set",
- P_("Horizontal Expand Set"),
- P_("Whether to use the hexpand property"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_HEXPAND_SET] =
+ g_param_spec_boolean ("hexpand-set",
+ P_("Horizontal Expand Set"),
+ P_("Whether to use the hexpand property"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:vexpand:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_VEXPAND,
- g_param_spec_boolean ("vexpand",
- P_("Vertical Expand"),
- P_("Whether widget wants more vertical space"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_VEXPAND] =
+ g_param_spec_boolean ("vexpand",
+ P_("Vertical Expand"),
+ P_("Whether widget wants more vertical space"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:vexpand-set:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_VEXPAND_SET,
- g_param_spec_boolean ("vexpand-set",
- P_("Vertical Expand Set"),
- P_("Whether to use the vexpand property"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_VEXPAND_SET] =
+ g_param_spec_boolean ("vexpand-set",
+ P_("Vertical Expand Set"),
+ P_("Whether to use the vexpand property"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:expand:
*
* Since: 3.0
*/
- g_object_class_install_property (gobject_class,
- PROP_EXPAND,
- g_param_spec_boolean ("expand",
- P_("Expand Both"),
- P_("Whether widget wants to expand in both directions"),
- FALSE,
- GTK_PARAM_READWRITE));
+ widget_props[PROP_EXPAND] =
+ g_param_spec_boolean ("expand",
+ P_("Expand Both"),
+ P_("Whether widget wants to expand in both directions"),
+ FALSE,
+ GTK_PARAM_READWRITE);
/**
* GtkWidget:opacity:
*
* Since: 3.8
*/
- g_object_class_install_property (gobject_class,
- PROP_OPACITY,
- g_param_spec_double ("opacity",
- P_("Opacity for Widget"),
- P_("The opacity of the widget, from 0 to 1"),
- 0.0,
- 1.0,
- 1.0,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ widget_props[PROP_OPACITY] =
+ g_param_spec_double ("opacity",
+ P_("Opacity for Widget"),
+ P_("The opacity of the widget, from 0 to 1"),
+ 0.0, 1.0,
+ 1.0,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:scale-factor:
*
* Since: 3.10
*/
- g_object_class_install_property (gobject_class,
- PROP_SCALE_FACTOR,
- g_param_spec_int ("scale-factor",
- P_("Scale factor"),
- P_("The scaling factor of the window"),
- 1,
- G_MAXINT,
- 1,
- GTK_PARAM_READABLE));
+ widget_props[PROP_SCALE_FACTOR] =
+ g_param_spec_int ("scale-factor",
+ P_("Scale factor"),
+ P_("The scaling factor of the window"),
+ 1, G_MAXINT,
+ 1,
+ GTK_PARAM_READABLE);
+
+ g_object_class_install_properties (gobject_class, NUM_PROPERTIES, widget_props);
+
+ /**
+ * GtkWidget::destroy:
+ * @object: the object which received the signal
+ *
+ * Signals that all holders of a reference to the widget should release
+ * the reference that they hold. May result in finalization of the widget
+ * if all references are released.
+ *
+ * This signal is not suitable for saving widget state.
+ */
+ widget_signals[DESTROY] =
+ g_signal_new (I_("destroy"),
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_CLEANUP | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
+ G_STRUCT_OFFSET (GtkWidgetClass, destroy),
+ NULL, NULL,
+ _gtk_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
/**
* GtkWidget::show:
*/
gtk_widget_set_parent_window (widget, NULL);
- g_object_notify (G_OBJECT (widget), "parent");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_PARENT]);
g_object_thaw_notify (G_OBJECT (widget));
if (!priv->parent)
g_object_notify_queue_clear (G_OBJECT (widget), nqueue);
gtk_css_node_set_visible (widget->priv->cssnode, TRUE);
g_signal_emit (widget, widget_signals[SHOW], 0);
- g_object_notify (G_OBJECT (widget), "visible");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_VISIBLE]);
gtk_widget_pop_verify_invariants (widget);
g_object_unref (widget);
g_signal_emit (widget, widget_signals[HIDE], 0);
if (!gtk_widget_is_toplevel (widget))
gtk_widget_queue_resize (widget);
- g_object_notify (G_OBJECT (widget), "visible");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_VISIBLE]);
gtk_widget_pop_verify_invariants (widget);
g_object_unref (widget);
gtk_widget_get_parent_window (widget));
}
- g_object_notify (G_OBJECT (widget), "parent");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_PARENT]);
}
}
g_object_ref (widget);
g_signal_emit (widget, widget_signals[GRAB_FOCUS], 0);
- g_object_notify (G_OBJECT (widget), "has-focus");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HAS_FOCUS]);
g_object_unref (widget);
}
widget->priv->can_focus = can_focus;
gtk_widget_queue_resize (widget);
- g_object_notify (G_OBJECT (widget), "can-focus");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_CAN_FOCUS]);
}
}
widget->priv->can_default = can_default;
gtk_widget_queue_resize (widget);
- g_object_notify (G_OBJECT (widget), "can-default");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_CAN_FOCUS]);
}
}
{
widget->priv->receives_default = receives_default;
- g_object_notify (G_OBJECT (widget), "receives-default");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_RECEIVES_DEFAULT]);
}
}
if (priv->context)
gtk_style_context_set_id (priv->context, priv->name);
- g_object_notify (G_OBJECT (widget), "name");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_NAME]);
}
/**
if (gtk_widget_is_drawable (widget))
gtk_widget_queue_draw (widget);
- g_object_notify (G_OBJECT (widget), "app-paintable");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_APP_PAINTABLE]);
}
}
{
widget->priv->double_buffered = double_buffered;
- g_object_notify (G_OBJECT (widget), "double-buffered");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_DOUBLE_BUFFERED]);
}
}
gtk_widget_queue_resize (widget);
}
- g_object_notify (G_OBJECT (widget), "sensitive");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_SENSITIVE]);
}
/**
g_signal_emit (widget, widget_signals[PARENT_SET], 0, NULL);
if (priv->parent->priv->anchored)
_gtk_widget_propagate_hierarchy_changed (widget, NULL);
- g_object_notify (G_OBJECT (widget), "parent");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_PARENT]);
/* Enforce realized/mapped invariants
*/
if (priv->context)
gtk_style_context_set_scale (priv->context, gtk_widget_get_scale_factor (widget));
- g_object_notify (G_OBJECT (widget), "scale-factor");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_SCALE_FACTOR]);
gtk_widget_queue_draw (widget);
if (width > -2 && aux_info->width != width)
{
if ((flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY) == 0)
- g_object_notify (G_OBJECT (widget), "width-request");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_WIDTH_REQUEST]);
aux_info->width = width;
changed = TRUE;
}
if (height > -2 && aux_info->height != height)
{
if ((flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY) == 0)
- g_object_notify (G_OBJECT (widget), "height-request");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HEIGHT_REQUEST]);
aux_info->height = height;
changed = TRUE;
}
{
g_object_set_qdata (G_OBJECT (widget), quark_event_mask,
GINT_TO_POINTER (events));
- g_object_notify (G_OBJECT (widget), "events");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_EVENTS]);
}
}
gtk_widget_update_devices_mask (widget, FALSE);
}
- g_object_notify (G_OBJECT (widget), "events");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_EVENTS]);
}
/**
if (gtk_widget_get_realized (widget))
gtk_widget_add_events_internal (widget, device, events);
- g_object_notify (G_OBJECT (widget), "events");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_EVENTS]);
}
/**
GtkOrientation orientation,
gboolean expand)
{
- const char *expand_prop;
- const char *expand_set_prop;
+ gint expand_prop;
+ gint expand_set_prop;
gboolean was_both;
GtkWidgetPrivate *priv;
priv->hexpand_set = TRUE;
priv->hexpand = expand;
- expand_prop = "hexpand";
- expand_set_prop = "hexpand-set";
+ expand_prop = PROP_HEXPAND;
+ expand_set_prop = PROP_HEXPAND_SET;
}
else
{
priv->vexpand_set = TRUE;
priv->vexpand = expand;
- expand_prop = "vexpand";
- expand_set_prop = "vexpand-set";
+ expand_prop = PROP_VEXPAND;
+ expand_set_prop = PROP_VEXPAND_SET;
}
gtk_widget_queue_compute_expand (widget);
g_object_freeze_notify (G_OBJECT (widget));
- g_object_notify (G_OBJECT (widget), expand_prop);
- g_object_notify (G_OBJECT (widget), expand_set_prop);
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[expand_prop]);
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[expand_set_prop]);
if (was_both != (priv->hexpand && priv->vexpand))
- g_object_notify (G_OBJECT (widget), "expand");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_EXPAND]);
g_object_thaw_notify (G_OBJECT (widget));
}
gboolean set)
{
GtkWidgetPrivate *priv;
- const char *prop;
+ gint prop;
priv = widget->priv;
return;
priv->hexpand_set = set;
- prop = "hexpand-set";
+ prop = PROP_HEXPAND_SET;
}
else
{
return;
priv->vexpand_set = set;
- prop = "vexpand-set";
+ prop = PROP_VEXPAND_SET;
}
gtk_widget_queue_compute_expand (widget);
- g_object_notify (G_OBJECT (widget), prop);
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[prop]);
}
/**
aux_info->halign = align;
gtk_widget_queue_resize (widget);
- g_object_notify (G_OBJECT (widget), "halign");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HALIGN]);
}
/**
aux_info->valign = align;
gtk_widget_queue_resize (widget);
- g_object_notify (G_OBJECT (widget), "valign");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_VALIGN]);
}
/**
aux_info->margin.left = margin;
gtk_widget_queue_resize (widget);
- g_object_notify (G_OBJECT (widget), "margin-left");
- g_object_notify (G_OBJECT (widget), rtl ? "margin-end" : "margin-start");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_MARGIN_LEFT]);
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[rtl ? PROP_MARGIN_END : PROP_MARGIN_START]);
}
/**
aux_info->margin.right = margin;
gtk_widget_queue_resize (widget);
- g_object_notify (G_OBJECT (widget), "margin-right");
- g_object_notify (G_OBJECT (widget), rtl ? "margin-start" : "margin-end");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_MARGIN_RIGHT]);
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[rtl ? PROP_MARGIN_START : PROP_MARGIN_END]);
}
/**
*start = margin;
gtk_widget_queue_resize (widget);
- g_object_notify (G_OBJECT (widget), "margin-start");
- g_object_notify (G_OBJECT (widget), rtl ? "margin-right" : "margin-left");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_MARGIN_START]);
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[rtl ? PROP_MARGIN_RIGHT : PROP_MARGIN_LEFT]);
}
/**
*end = margin;
gtk_widget_queue_resize (widget);
- g_object_notify (G_OBJECT (widget), "margin-end");
- g_object_notify (G_OBJECT (widget), rtl ? "margin-left" : "margin-right");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_MARGIN_END]);
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[rtl ? PROP_MARGIN_LEFT : PROP_MARGIN_RIGHT]);
}
/**
aux_info->margin.top = margin;
gtk_widget_queue_resize (widget);
- g_object_notify (G_OBJECT (widget), "margin-top");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_MARGIN_TOP]);
}
/**
aux_info->margin.bottom = margin;
gtk_widget_queue_resize (widget);
- g_object_notify (G_OBJECT (widget), "margin-bottom");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_MARGIN_BOTTOM]);
}
/**
{
widget->priv->no_show_all = no_show_all;
- g_object_notify (G_OBJECT (widget), "no-show-all");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_NO_SHOW_ALL]);
}
}
g_object_set_qdata (G_OBJECT (widget), quark_has_tooltip,
GUINT_TO_POINTER (priv_has_tooltip));
- g_object_notify (G_OBJECT (widget), "has-tooltip");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HAS_TOOLTIP]);
}
}
{
priv->window = window;
- g_object_notify (G_OBJECT (widget), "window");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_WINDOW]);
}
}
gtk_widget_update_alpha (widget);
- g_object_notify (G_OBJECT (widget), "opacity");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_OPACITY]);
}
/**
res = gtk_widget_event (widget, event);
- g_object_notify (G_OBJECT (widget), "has-focus");
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HAS_FOCUS]);
g_object_unref (widget);